desc "Set proper lat/long values for every site"
task :set_coord => [:environment] do
  include Geokit::Geocoders
    Site.all.each do |s|
      if s.latitude.nil?
        lat = MultiGeocoder.geocode(s.city, Country.find(s.country).name).lat
        Site.update(s.id, :latitude =>  lat)   
      end
      if s.longitude.nil?
        lng = MultiGeocoder.geocode(s.city, Country.find(s.country).name).lng
        Site.update(s.id, :longitude =>  lng)
      end
    end
end





